<html>
<head><title>INGRESAR DATOS</title><meta content="">
<style>
</style>
</head>

<?php

//VALIDATE DATA
 if(!isset($_POST["latField"]))header('Location:/');

//CONNECT TO DB
 $con = mysql_connect("localhost","bob",""); 
 mysql_select_db("city",$con);

//FETCH CLASSIFICATIONS
 $classifications=array();
 $result = mysql_query("SELECT * FROM classifications");
 for($i=0;$row = mysql_fetch_array($result);$i++)
  $classifications[$i]=$row['classification'];
?>

<body>
 <TABLE>
 <tr><td colspan="2"><h1 align="center">PASO 2: INGRESAR DATOS</h1></td></tr>
 <tr><td><form action="publish.php" method="post">
   <TABLE>
   <tr><td>Nombre:</td><td><input type="text" name="nameField"></td></tr>
   <tr><td>Clasificacion:</td><td><select name="classificationSelect">
    <?php 
     foreach($classifications as $classification)
      echo "<option>".$classification."</option>";
    ?>
    </select></td></tr>
   <tr><td>Subclasificacion:</td><td><input type="text" name="subclassificationField"></td></tr>
   <tr><td>Calle:</td><td><input type="text" name="streetField"></td></tr>
   <tr><td>Numero:</td><td><input type="text" name="numberField"></td></tr>
   <tr><td>Codigo Postal:</td><td><input type="text" name="postalcodeField"></td></tr>
   <tr><td>Telefono:</td><td><input type="text" name="telField"></td></tr>
   <tr><td>Pagina:</td><td><input type="text" name="pageField"></td></tr>
   <tr><td>eMail:</td><td><input type="text" name="mailField"></td></tr>
   <tr><td>CODIGO:</td><td><img src="random_number.php"></td></tr>
   <tr><td>COPIA:</td><td><input type="text" name="randomNumberField">*</td></tr>
   <tr><td><input type="submit" value="Publicar Datos"/></td></tr>
   </TABLE>
   <input type="hidden" name="latField" value="<?php echo $_POST["latField"];?>">
   <input type="hidden" name="lngField" value="<?php echo $_POST["lngField"];?>">
  </form>
  </td><td><img src="/img/enter_data.png"/></td><tr>
  <tr><td colspan="2"> * COPIAR EL CODIGO DE SEGURIDAD EN EL CAMPO ANTES DE PUBLICAR.</td></tr>
  <tr><td colspan="2"> * SI DIFIEREN EL PROCESO SE REINICIARA.</td></tr>
 </TABLE>
</body>

</html>








<?php//echo $_POST["latField"];?>

